package com.ys.service.wallet.base;

import com.ys.entity.WalletWithdraw;
import com.ys.entity.block.Block;
import com.ys.entity.block.Gather;
import com.ys.entity.block.Transaction;
import com.ys.entity.vo.Withdraw;
import com.ys.enu.CurrencyEnum;
import com.ys.web.base.ResultBody;

import java.math.BigInteger;

/**
 * 钱包service
 */
public interface IWalletService {


    ResultBody createAddress() ;
    ResultBody validateAddress(String address);
    ResultBody balanceByAddress(String address);
    /**
     * 提币
     * @param withdraw
     * @return
     */
    ResultBody withDraw(Withdraw withdraw);

    /**
     * 查询块通过块号
     * @param num
     * @return
     */
    Block queryBlockByNum(Integer num, Block b);

    /**
     * 查询块通过
     * @param hash
     * @return
     */
    String queryBlockByHash(String hash);

    /**
     * 获取最近的区块号用来判断 交易是否成功
     * @return
     */
    String mostRecentBlockNumber();

    /**
     * 根据交易hash查询交易
     * @param txHash 交易hash
     * @return
     */
    Transaction queryTransactionByHash(String txHash,Transaction t);

    /**
     * 根据地址查询钱包余额
     * @param address 钱包地址
     * @return
     */
    BigInteger  queryBalanceByAddress(String address);

    /**
     * 发送提币交易
     * @param walletWithdraw
     * @return
     */
    String sendWithDraw(WalletWithdraw walletWithdraw);

    /**
     * 发送归集交易
     * @param gather
     * @return
     */
    String sendGatherTransation(Gather gather);

    CurrencyEnum currencyEnum();

    String name();
    Integer getCurrency();
}
